package com.example.AIstudy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.AIstudy.dao.CompositionDao;
import com.example.AIstudy.dao.CuoTiJiDao;
import com.example.AIstudy.domain.CompositionDetail;
import com.example.AIstudy.domain.CuoTiJi;
import com.example.AIstudy.exception.AIstudyException;
import com.example.AIstudy.service.CompositionService;
import com.example.AIstudy.service.CuoTiJiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CompositionServiceImpl extends ServiceImpl<CompositionDao, CompositionDetail> implements CompositionService {
    @Autowired
    CompositionDao compositionDao;
    public void insertCompositionDetail(CompositionDetail compositionDetail) throws AIstudyException{
        try{
        compositionDao.insertCompositionDetail(compositionDetail);
        }catch (Exception e){
            System.out.println(e.getMessage());
            throw new AIstudyException(AIstudyException.ErrorType.INSERT_ERROR,"添加习题失败");
        }
    }
}
